A file server is a computer that provides file service relating to the organization of information on writeable persistent storage devices, such as memories, tapes or disks. The file server or filer may be embodied as a storage system including a storage operating system that implements a file system to logically organize the information as a hierarchical structure of directories and files on, e.g. the disks. Each “on-disk” file may be implemented as a set of data structures, e.g. disk blocks, configured to store information, such as the actual data for the file. A directory, on the other hand, may be implemented as a specially formatted file in which information about other files and directories is stored.
A filer may be further configured to operate according to a client/server model of information delivery to thereby allow many client systems (clients) to access shared resources, such as files, stored on a server, e.g. the filer. In this model, the client may comprise an application, such as a database management system (DBMS), executing on a computer that “connects” to the filer over a computer network, such as a point-to-point link, shared local area network (LAN), wide area network (WAN) or virtual private network (VPN) implemented over a public network, such as the Internet. Each client may request the services of the filer by issuing file system protocol messages (in the form of packets) to the filer over the network. By supporting a plurality of file system protocols, such as the Direct Access File System (DAFS) protocol, the utility of the filer may be enhanced for networking clients. The DAFS protocol is a distributed file system protocol that, inter alia, defines a set of file management and file access operations.
In certain client/server environments, clients may desire to create a client-private file. As used herein, the term client-private generally means that a file is not “visible” to other clients of a file server other than to the client creating the client-private file. The client-private file may be stored on-disk, but may not be incorporated into the directory structure associated with the file system; accordingly, other clients cannot identify or access the file. In effect, a client creating a client-private file is creating a “scratch pad” for temporary storage of data. The client may, at a later time, decide to permanently store the data in the file. In such a case, the client can “link” the client-private file to the file system so that it is accessible to any clients of the file system.
A DBMS application is an example of a client application that would utilize client-private files. The DBMS application is a program that allows one or more users or clients to create and access data stored in a set of files or database coupled to, e.g., a filer. In particular, the DBMS application manages client requests to access the database without requiring them to specify the physical location of the data on the storage devices. In handling client requests, the DBMS application ensures the integrity of the data (i.e., ensuring that the data continues to be accessible and is consistently organized as intended) and the security of the data (i.e., ensuring only those with appropriate privileges can access the data). The integrity and security of a database is particularly relevant in parallel or distributed system computing environments.
In known file system protocol implementations, such as the DAFS protocol, a client-private file can be created through the use of a two-step procedure. First, the client creates the file using the standard file open functions of the file system protocol. By opening the file, the file system protocol returns a file handle, which uniquely identifies the file and its path. After opening or creating the file, the client then unlinks the file, i.e., removes the path name from the file while retaining the file handle. Removal of the path name prevents other clients from identifying or accessing the file by, e.g., scanning a directory path structure associated with the file system.
A disadvantage of this known two-step procedure involves a crash or other error condition/failure experienced by the client between creation and unlinking of the files that results in client-private files no longer being associated with an active client. If, for example, a client created a client-private file and then suffered a failure before unlinking the file, the opened file would remain in the file system. This would require a search to obtain, and then eliminate, the previously opened, but not unlinked file. If the file is not found and eliminated, the file system would become populated with such unused files. This would result in the consumption of storage capacity within the file system, thereby reducing the available file system storage space for files that are used by clients of the file server.
Therefore, the present invention is directed to a mechanism that reduces the consumption of storage capacity for previously opened, but not unlinked files. The invention is also directed, in part, to providing support for the creation of unlinked files using a distributed file system protocol, such as the DAFS protocol.